<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="__ADMIN_CSS__/bootstrap.min.css">
</head>
<body>
<div class="alert alert-info">
   1.在此显示客户基本信息，和客户分配记录(如果有)，以及客户移交记录(如果有)
</div>
<table class="table table-bordered table-builder table-response">
    {foreach name="customer_info" item="v"}
    <tr>
        {if condition="$key eq 0"}
        <td rowspan="{:count($customer_info)}" style="font-weight: bold">客户基本信息</td>
        {/if}
        <td>{$v[2]}</td>
        <td colspan="5">{$customer[$v[1]]}</td>
    </tr>
    {/foreach}
    {notempty name="dis_log"}
    <tr>
        <td rowspan="4" style="font-weight: bold">分配记录</td>
        <td>分配时间</td>
        <td colspan="5">
            {php}
            if(!empty($dis_log['time'])):
            echo date("Y-m-d H:i:s",$dis_log['time']);
            else:
            echo '';
            endif;
            {/php}
        </td>
    </tr>
    <tr>
        <td>分配客户</td>
        <td colspan="5">{$dis_log['customer']}</td>
    </tr>
    <tr>
        <td>分配客户经理</td>
        <td colspan="5">{$dis_log['manager']}</td>
    </tr>
    <tr>
        <td>操作人员</td>
        <td colspan="5">{$dis_operator}</td>
    </tr>
    {/notempty}
    {foreach name="turn_log" item="v"}
    {if condition="$key eq 0"}
    <tr>
        <td rowspan="{:count($turn_log) + 1}" style="font-weight: bold">客户移交记录</td>
        <td style="font-weight: bold">客户</td>
        <td style="font-weight: bold">原客户经理</td>
        <td style="font-weight: bold">移交客户经理</td>
        <td style="font-weight: bold">开始时间</td>
        <td style="font-weight: bold">完成时间</td>
        <td style="font-weight: bold">移交状态</td>
    </tr>
    {/if}
    <tr>
        <td>{$v.customer}</td>
        <td>{$v.old_manager}</td>
        <td>{$v.manager}</td>
        <td>{$v.start_time}</td>
        <td>{$v.time}</td>
        <td>{$v.status}</td>
    </tr>
    {/foreach}
    <!--贷款记录-->
    {notempty name="loan_log"}
    <tr>
        <td rowspan="{:count($loan_log) + 1}" style="font-weight: bold">客户贷款记录</td>
        <td style="font-weight: bold">客户</td>
        <td style="font-weight: bold">借据号</td>
        <td style="font-weight: bold">贷款金额/元</td>
        <td style="font-weight: bold">贷款日期</td>
        <td style="font-weight: bold">贷款时长/月</td>
        <td style="font-weight: bold">贷款类型</td>
    </tr>
    {foreach name="loan_log" item="v"}
    <tr>
        <td>{$v.name}</td>
        <td>{$v.number}</td>
        <td>{$v.money}</td>
        <td>{$v.time|date="Y-m-d H:i:s",###}</td>
        <td>{$v.loan_time}</td>
        <td>
            {php}
                if(!empty($v['type_id'])):
                    echo $loan_type[$v['type_id']];
                endif;
            {/php}
        </td>
    </tr>
    {/foreach}
    {/notempty}
    <!--存款记录-->
    {notempty name="deposit_log"}
    <tr>
        <td rowspan="{:count($deposit_log) + 1}" style="font-weight: bold">客户存款记录</td>
        <td style="font-weight: bold">客户</td>
        <td style="font-weight: bold">存款单号</td>
        <td style="font-weight: bold">存款金额/元</td>
        <td style="font-weight: bold">存款日期</td>
        <td style="font-weight: bold">存款时长/月</td>
    </tr>
    {foreach name="deposit_log" item="v"}
    <tr>
        <td>{$v.name}</td>
        <td>{$v.number}</td>
        <td>{$v.money}</td>
        <td>{$v.time|date="Y-m-d H:i:s",###}</td>
        <td>{$v.deposit_time} </td>
    </tr>
    {/foreach}
    {/notempty}
</table>
</body>
</html>